<!-- Inicio codigo para el Google MAPS -->
<%= stylesheet_link_tag 'gmaps4rails' %>
<!-- Fin codigo para el Google MAPS -->
<% if flash[:notice] %>
    <div id="notice"><%= flash[:notice] %></div>
<% end %>
<fieldset id="agrupacion" >
  <legend>Datos</legend>    
  

  <fieldset class="column-left">
    <fieldset id="agrupacion" >
      <legend>Datos Patrimonio Cultural</legend>
      <div class="field">
        <b>Patrimonio:</b>
        <%= @cultural_heritage_incidence.obj_cultural_heritage.name %>
        <br></br>
       
      </div>
    </fieldset>

    <fieldset id="agrupacion" >
      <legend>Datos Responsable Incidencia</legend>
      <div class="field">
        <b>DNI:</b>
        <%= @cultural_heritage_incidence.dniResponsable %>
        <br></br>
        <b>Nombre:</b>
        <%= @cultural_heritage_incidence.fullNameResponsable %>
      </div>
    </fieldset>

    <fieldset id="agrupacion" >
      <legend>Lugar y Fecha</legend>
      <div class="field">
        <b>Fecha de Incidencia:</b>
        <%= @cultural_heritage_incidence.date_incidence %>
        <br></br>
        <b>Referencia Localización:</b>
        <%= @cultural_heritage_incidence.location %>
      </div>
    </fieldset>
    
  </fieldset>
  <fieldset class="column-right">
    <%if ! @cultural_heritage_incidence.avatar_file_name.blank? %>
    <fieldset id="agrupacion" >
      <legend>Imagen</legend>
      <div class="field">
        <a href=<%@cultural_heritage_incidence.avatar.url%> rel="lightbox[roadtrip]"><%= image_tag @cultural_heritage_incidence.avatar.url, :alt => "Cargando...", :width => 150, :height => 150, :title => "Imagen de Incidencia"%></a>
      </div>
    </fieldset>
    <%end%>
    <fieldset id="agrupacion" >
      <legend>Descripción</legend>
      <div class="field">
        <b>Descripción breve:</b>
        <%= @cultural_heritage_incidence.briefDesc %>
        <br></br>
        <b>Descripción Completa:</b>
        <%= @cultural_heritage_incidence.completeDesc %>
      </div>
    </fieldset>
  </fieldset>
  
<%#*<b>Usuario :</b>%>
<%#= @cultural_heritage_incidence.obj_user.name + " " + @cultural_heritage_incidence.obj_user.lastname %>

</fieldset>
<%if [3,4,5].include?(@cultural_heritage_incidence.state) %>
<fieldset id="agrupacion" >
  <legend>Investigación Incidencia</legend>
  <%if !(@cultural_heritage_incidence.state.blank?)%>

    <%if [3,4,5].include?(@cultural_heritage_incidence.state) %>
      <fieldset class="column-left">
        <fieldset id="agrupacion" >
          <legend>Miembro del INC - Investigación Incidencia</legend>
          <%if !@cultural_heritage_incidence.obj_person1.nil? %>
          <div class="field">
            <b>Persona:</b>
            <%= @cultural_heritage_incidence.obj_person1.name + " " +@cultural_heritage_incidence.obj_person1.lastname%>
            <br></br>
            <b>Correo:</b>
            <%= @cultural_heritage_incidence.obj_person1.email%>
            <br></br>
            <b>Comentario:</b>
            <%= @cultural_heritage_incidence.coment1 %>
          </div>
          <%end%>
        </fieldset>
      </fieldset>
    <%end%>

    <%if [4,5].include?(@cultural_heritage_incidence.state) %>
      <fieldset class="column-right">
        <fieldset id="agrupacion" >
          <legend>Jefe del INC - Investigación Incidencia</legend>
          <%if !@cultural_heritage_incidence.obj_person2.nil? %>
          <div class="field">
            <b>Persona:</b>
            <%= @cultural_heritage_incidence.obj_person2.name + " " +@cultural_heritage_incidence.obj_person2.lastname%>
            <br></br>
            <b>Correo:</b>
            <%= @cultural_heritage_incidence.obj_person2.email%>
            <br></br>
            <b>Comentario:</b>
            <%= @cultural_heritage_incidence.coment2 %>
          </div>
          <%end%>
        </fieldset>
      </fieldset>
    <%end%>
    <%if [5].include?(@cultural_heritage_incidence.state) %>
      <fieldset class="column-left">
        <fieldset id="agrupacion" >
          <legend>Experto Legal - Investigación Incidencia</legend>
          <%if !@cultural_heritage_incidence.obj_person3.nil?%>
          <div class="field">
            <b>Persona:</b>
            <%= @cultural_heritage_incidence.obj_person3.name + " " +@cultural_heritage_incidence.obj_person3.lastname%>
            <br></br>
            <b>Correo:</b>
            <%= @cultural_heritage_incidence.obj_person3.email%>
            <br></br>
            <b>Comentario:</b>
            <%= @cultural_heritage_incidence.coment3 %>
          </div>
          <%end%>
        </fieldset>
      </fieldset>
    <%end%>

  <%end%>
</fieldset>
<%end%>
<%if @cultural_heritage_incidence.gmaps == true %>
  <fieldset id="agrupacion">
    <legend>Ubicación</legend>
  <%#= gmaps4rails(@json) %>
    <%= gmaps({
        "map_options" => { "type" => "HYBRID", "center_longitude" => 180, "zoom" => 7, "auto_adjust" => true},
        "markers"     => { "data" => @json,
          #"options" => {"list_container" => "markers_list" }
        }


      })%>
    <% if ! @cultural_heritage_incidence.address.blank? %>
      <p>
        <b>Dirección:</b>
        <%= @cultural_heritage_incidence.address %>
      </p>
    <%end%>
  </fieldset>
  <div id="lineaform"></div>
<%end%>


<%= link_to 'Editar', edit_cultural_heritage_incidence_path(@cultural_heritage_incidence) %> |
<%= link_to 'Regresar', cultural_heritage_incidences_path %> |
<%= link_to 'Exportar a PDF',{:controller => '/report/incidence_report', :action => 'pdf_export', :id => @cultural_heritage_incidence.id}%>
